package net.ossrs.yasea.demo;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;


public class SecondAct extends AppCompatActivity {

    private static final String TAG = SecondAct.class.getCanonicalName();
    private Button btnStart;
    private Button btnStartr;
    private Button btnStop;
    private Button btnStopr;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sec);
//        LiveVideoManager.getInstance().initLive();
        btnStart = findViewById(R.id.btn_start);
        btnStartr = findViewById(R.id.btn_startr);
        btnStopr = findViewById(R.id.btn_stopr);
        btnStop = findViewById(R.id.btn_stop);
        btnStop.setEnabled(false);
        btnStart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
//                LiveVideoManager.getInstance().startLive();
                view.setEnabled(false);
                btnStop.setEnabled(true);
            }
        });

        btnStop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
//                LiveVideoManager.getInstance().stopLive();
                view.setEnabled(false);
                btnStart.setEnabled(true);

            }
        });     btnStartr.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LiveVideoManager.getInstance().startRecord();
            }
        });

        btnStopr.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
               LiveVideoManager.getInstance().stopRecord();

            }
        });
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "onDestroy: ");
        LiveVideoManager.getInstance().stopFloatWindow();

    }
}
